const utils = {
  toast(title = '数据加载中...') {
    wx.showToast({
      title,
      mask: true,
      icon: 'none'
    })
  },
  // 时间格式化函数
  formatDate(time) {
    const date = new Date(time)
    const year = date.getFullYear()
    let month = date.getMonth() + 1
    let day = date.getDate()
    // 补零
    if(month < 10) month = '0' + month
    if(day < 10) day = '0' + day
    return `${year}/${month}/${day}`
  }
}
wx.utils = utils
export default utils